#include<bits/stdc++.h> 
using namespace std;
//	与乙级1020一致
struct YB{
	float kc;
	float zj;
	float dj;
};
bool cmp(YB a, YB b){
	if(a.dj != b.dj) return a.dj>b.dj;
	else return a.kc>b.kc;
}
int main(){
	int n;
	int d;
	cin>>n>>d;
	YB yb[n];
	float ks[n];
	float zs[n];
	for(int i=0;i<n;i++){
		scanf("%f", &ks[i]);
	}
	for(int i=0;i<n;i++){
		scanf("%f", &zs[i]);
	}
	for(int i=0;i<n;i++){
		yb[i].kc = ks[i];
		yb[i].zj = zs[i];
		yb[i].dj = yb[i].zj / yb[i].kc;
	}
	sort(yb, yb+n, cmp);
	int i = 0;
	float sy = 0;
	while(true){
		if(i>=n){
			break;
		}
		if(d<=yb[i].kc){
			sy = sy+d*yb[i].dj;
			break;
		}
		else{
			d = d - yb[i].kc;
			sy = sy + yb[i].zj;
			i++; 
		}
	}
	printf("%.2f\n", sy);
	return 0;
}